@echo off
echo Starting IoT Communication Server...

REM Check if target directory exists
if not exist "target\classes" (
    echo Error: Project not compiled! Please run 'mvn compile' first.
    echo.
    pause
    exit /b 1
)

REM Run server application using Maven exec plugin
echo Running server application...
mvn exec:java -Dexec.mainClass="com.iotcomm.server.ServerApp" -Dexec.args="" -q

echo.
echo Press any key to exit...
pause > nul